function http({
	url,
	method = "get",
	data
}) {
	// #ifdef H5
	let baseURL = '/api'
	// #endif
	// #ifndef H5
	let baseURL = 'http://124.223.9.151:8000'
	// #endif
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseURL + url,
			method: method,
			data: data,
			withCredentials:true,
			success: (res => {
				uni.setStorageSync('JSESSIONID', res.cookies.toString().substring(11, 51));
				resolve(res.data);
			}),
			fail: (err => {
				resolve(err);
			})
		})
	})
}

export default http